//
//  BSRecommendCategoryViewModel.m
//  sister
//
//  Created by 周冰烽 on 2017/2/14.
//  Copyright © 2017年 周冰烽. All rights reserved.
//

#import "BSRecommendCategoryViewModel.h"

@implementation BSRecommendCategoryViewModel
-(NSInteger)rowNumber{
    return self.list.count;
}
-(NSString *)name:(NSInteger)index{
    return self.list[index].name;
}
-(NSInteger)ID:(NSInteger)index{
    return self.list[index].ID;
}
-(NSMutableArray<List *> *)list{
    if (_list == nil) {
        _list = [NSMutableArray<List *> new];
    }
    return _list;
}
-(void)getListWithA:(NSString *)a C:(NSString *)C completionHandler:(void (^)(NSError *))completionHandler{
    [BSNetManager recommendCategoryDataWithA:a c:C completionHandler:^(BSRecommendCategory *model, NSError *error) {
        [self.list removeAllObjects];
        [self.list addObjectsFromArray:model.list];
        completionHandler(error);
    }];
}
@end
